jQuery.noConflict();
var aeRequest;
var UserArray = new Array();
function createResponseXML(textXML) {
    // code for IE
    if (window.ActiveXObject) {
        var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
        xmlDoc.async = "false";
        xmlDoc.loadXML(textXML);
        return xmlDoc;
    }
    // code for Mozilla, Firefox, Opera, etc.
    else {
        var parser = new DOMParser();
        var xmlDoc = parser.parseFromString(textXML, "text/xml");
        return xmlDoc;
    }
}
function createXmlHttpRequestObject() {
    var ro;
    var browser = navigator.appName;
    // Need to determine IE7 and not do this.
    if (browser == "Microsoft Internet Explorer") {
        ro = new ActiveXObject("Microsoft.XMLHTTP");
    } else {
        ro = new XMLHttpRequest();
    }
    return ro;
}
function getSessionByAjax(){
    var url='';//getsession login
    aeRequest = createXmlHttpRequestObject();
    aeRequest.open("POST", url, true);
    aeRequest.setRequestHeader("Content-type",
    "application/x-www-form-urlencoded");
    aeRequest.setRequestHeader("Content-length", 0);
    aeRequest.setRequestHeader("Connection", "close");
    aeRequest.onreadystatechange = function() {
        if (aeRequest.readyState == 4) {
            if (aeRequest.status == 200) {
                var response = createResponseXML(aeRequest.responseText);
                var result = response.getElementsByTagName("result")[0].firstChild.nodeValue;	
                if(result == 'error'){
                   
                }else{
                    var name = response.getElementsByTagName("username")[0].firstChild.nodeValue;
                    var id = response.getElementsByTagName("id")[0].firstChild.nodeValue;
                    var type_user = response.getElementsByTagName("type")[0].firstChild.nodeValue;
                    UserArray.splice(0,UserArray.length);
                    UserArray.push(new Array(id,name,type_user));
                    
                }
            }
        }

    };
    aeRequest.send(null);
}